package com.campus.service.impl;

import com.campus.service.ClassService;
import com.campus.dao.ClassDao;
import com.campus.model.Class;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @desc:
 * @author: Tournesol234
 * @date: 2024/11/22 14.41
 */
@Service
public class ClassServiceImpl implements ClassService {

    private final ClassDao classDao;

    @Autowired
    public ClassServiceImpl(ClassDao classDao) {
        this.classDao = classDao;
    }

    @Override
    public int createClass(Class cls) {
        return classDao.createClass(cls);
    }

    @Override
    public int updateClass(Class cls) {
        return classDao.updateClass(cls);
    }

    @Override
    public int addStudentsToClass(int classId, List<Integer> studentIds) {
        return classDao.addStudentsToClass(classId, studentIds);
    }

    @Override
    public int assignTeachersToClass(int classId, List<Integer> teacherIds) {
        return classDao.assignTeachersToClass(classId, teacherIds);
    }

    @Override
    public Class getClassById(int id) {
        return classDao.getClassById(id);
    }

    @Override
    public List<Class> getClassesByActivityId(int activityId) {
        return classDao.getClassesByActivityId(activityId);
    }

    @Override
    public List<Class> getAllClasses() {
        return classDao.getAllClasses();
    }

    @Override
    public int deleteClass(int classId) {
        return classDao.deleteClass(classId);
    }
}